﻿@model FlashCards.WebApp.Models.UserModel
@{
    ViewBag.Title = "ViewProfile";
}
<h2>
    ViewProfile</h2>
@if (Model != null)
{
    using (Html.BeginForm("ViewProfile", "Account", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        <div>
            @Html.HiddenFor(x => Model.Id)
            @Html.HiddenFor(x => Model.Nick)
        </div>
    <div>
        @Html.LabelFor(x => Model.Name)
        @Html.EditorFor(x => Model.Name)
        @Html.ValidationMessageFor(x => Model.Name)
    </div>
    <div>
        @Html.LabelFor(x => Model.Surname)
        @Html.EditorFor(x => Model.Surname)
        @Html.ValidationMessageFor(x => Model.Surname)
    </div>
    <div>
        @Html.LabelFor(x => Model.BirthDate)
        @Html.EditorFor(x => Model.BirthDate)
        @Html.ValidationMessageFor(x => Model.BirthDate)
    </div>
    <div>
        @Html.Label("Zdjęcie profilowe")
        <img src='@Url.Action("GetUserAvatar", "Friends", new { userId = Model.Id })' alt="Avatar" />
    </div>
    
    
    <input name="avatar" type="file" value="zmień zdjęcie profilowe" runat="server" />
    <div>
        @Html.ActionLink("Zmień hasło", "ChangePassword")
    </div>
    <input type="submit" value="zapisz zmiany" />
    
    }
}